﻿using System;
using System.Collections.Generic;
using System.Text;

namespace KingOfCSharp.iHunter.Plugins.RssReader
{
    class RssChannelProvider : IChannelProvider
    {
        #region IChannelProvider Members

        public IChannel CreateChannelInstance(ChannelInfo info)
        {
            IChannel channel = null;
            try
            {
                channel = new RssChannel(info.Settings);
            }
            catch
            {
                return null;
            }
            return channel;
        }

        public System.Windows.Forms.UserControl GetChannelConfigureEditor()
        {
            return new RssConfigDialog();
        }

        public System.Windows.Forms.UserControl[] GetNewChannelWizardPages()
        {
            return new System.Windows.Forms.UserControl[1] { new RssConfigDialog() };
        }

        #endregion

        #region IPlugin Members

        public Guid Guid
        {
            get 
            {
                return new Guid("3B07E46D-484C-42e7-922C-E5101D0FD620");
            }
        }

        public void Initialize(IPluginClient client)
        {
            //do nothing
        }

        public System.Windows.Forms.UserControl GetPluginConfigureEditor()
        {
            return null;
        }

        public event PluginErrorEventHandler ErrorOccur;

        #endregion

        #region IDisposable Members

        public void Dispose()
        {
            //do nothing
        }

        #endregion


        #region IPlugin 成员


        public string Name
        {
            get { return "RSS Reader"; }
        }

        public string Description
        {
            get { return "An RSS reed reader"; }
        }

        #endregion

        #region IChannelProvider 成员


        public Guid NewMesssageEditorGuid
        {
            get { return Guid.Empty; }
        }

        #endregion
    }
}
